//
//  RecentListViewController.m
//  Paparazzi
//
//  Created by Miguel Sánchez Valdés on 27/04/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "RecentListViewController.h"
#import "PhotoDetailViewController.h"

@implementation RecentListViewController


 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
		self.title = @"Recents";
    }
	
	
	 UITabBarItem *item = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemRecents tag:0];
	 self.tabBarItem = item; 
	 [item release];
	
    return self;
}



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    
	labelPhoto1.text = [NSString stringWithFormat:@"Carolina 1"]; 
	labelPhoto2.text = [NSString stringWithFormat:@"Miguel 1"]; 
	labelPhoto3.text = [NSString stringWithFormat:@"Paisajes 1"];
	
	ownerPhotoLabel1.text = [NSString stringWithFormat:@"Carolina"]; 
	ownerPhotoLabel2.text = [NSString stringWithFormat:@"Miguel"]; 
	ownerPhotoLabel3.text = [NSString stringWithFormat:@"Paisajes"];
	
	image1.image = [UIImage imageNamed:@"carolina.jpg"];
	image2.image = [UIImage imageNamed:@"miguel.jpg"];
	image3.image = [UIImage imageNamed:@"paisajes.jpg"];
	

}


- (IBAction)pushFirst:(id)sender{
	
	[self pushViewController:@"Carolina"];
	
}

- (IBAction)pushSecond:(id)sender{
	
	[self pushViewController:@"Miguel"];
	
}

- (IBAction)pushThird:(id)sender{
	
	[self pushViewController:@"Paisajes"];
	
}

- (void)pushViewController:(NSString *)name{
	
	PhotoDetailViewController *photoShowedViewController = [[PhotoDetailViewController alloc] init];
	//photosListViewController.title = [NSString stringWithFormat:@"Fotos de %@", name];
	//photoShowedViewController.label = name;
	
	[self.navigationController pushViewController:photoShowedViewController animated:YES];
	[photoShowedViewController release];
	
}

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
